package com.gr.experimental.model.impl.distr.operators;


public final class EqualityOperator extends AbstractBinaryOperator {

	/**
	 * @param argument1Type
	 * @param argument2Type
	 */
	public EqualityOperator(Class<?> argument1Type, Class<?> argument2Type) {
		super(argument1Type, argument2Type);
		// TODO: consider throwing exception if types differ
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.impl.distr.operators.BinaryOperator#getReturnType()
	 */
	@Override
	public Class<?> getReturnType() {
		return Boolean.class;
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.model.impl.distr.operators.BinaryOperator#op(java.lang.Object, java.lang.Object)
	 */
	@Override
	public Object op(Object arg1, Object arg2) {
		
		// TODO: add null value check, consider == vs. equals
		return arg1.equals(arg2);
	}

}
